﻿using DataServer.ApplicationLib.Controls;

namespace DataServer.ApplicationLib.Rules
{
    public class ControlVerifyFactory
    {
        public static IControlModelVerify? CreateVerify(CreateCtrlVerifyInput input)
        {
            IControlModelVerify? verfiyObj = null;
            if (nameof(ControlTextBox) == input.ControlType)
            {
                verfiyObj = TextBoxModelVerifyFactory.CreateTextBoxVerify(input);
            }
            else
            {
                verfiyObj = NoNeedVerifyFactory.CreateNoNeedModelVerify(input);
            }
            return verfiyObj;
        }
    }

    public class CreateCtrlVerifyInput
    {
        public string? CheckWay
        {
            get;
            set;
        }

        public string? ControlType
        {
            get;
            set;
        }

        public string? ControlContent
        {
            get;
            set;
        }

        public string? TargetFieldColumn
        {
            get;
            set;
        }
    }
}
